package com.dfbz.demo06.重写的特点;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo01 {
    public static void main(String[] args) {

        Cat cat=new Cat();
        cat.eat();

        System.out.println("------------");

        Dog dog=new Dog();
        dog.eat();
    }
}
// 子类通常要比父类更加的具体,更加的明确
class Animal{
    public void eat(){
        System.out.println("吃饭~");
    }
}

class Cat extends Animal{
    public void eat(){
        System.out.println("猫吃鱼....");
    }
}

class Dog extends Animal{
    public void eat(){
        System.out.println("狗吃骨头....");
    }

}
